.class public Lcom/waiqin365/lightapp/sales/b/a/e;
.super Lcom/waiqin365/lightapp/sales/b/c;


# direct methods
.method public constructor <init>(Ljava/lang/String;Lcom/waiqin365/lightapp/sales/c/a;Ljava/lang/String;Ljava/lang/String;)V
    .locals 14

    const/16 v2, 0x3f0

    invoke-direct {p0, v2}, Lcom/waiqin365/lightapp/sales/b/c;-><init>(I)V

    const-string/jumbo v2, "/app/xlsb/client/v1/saveSales.action"

    iput-object v2, p0, Lcom/waiqin365/lightapp/sales/b/a/e;->c:Ljava/lang/String;

    iget-object v2, p0, Lcom/waiqin365/lightapp/sales/b/a/e;->e:Ljava/util/HashMap;

    const-string/jumbo v3, "Content-Type"

    const-string/jumbo v4, "application/x-www-form-urlencoded"

    invoke-virtual {v2, v3, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :try_start_0
    iget-object v2, p0, Lcom/waiqin365/lightapp/sales/b/a/e;->e:Ljava/util/HashMap;

    const-string/jumbo v3, "auth-code"

    invoke-virtual {v2, v3, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    :goto_0
    iget-object v2, p0, Lcom/waiqin365/lightapp/sales/b/a/e;->d:Ljava/util/HashMap;

    const-string/jumbo v3, "data.cm_id"

    move-object/from16 v0, p2

    iget-object v4, v0, Lcom/waiqin365/lightapp/sales/c/a;->h:Ljava/lang/String;

    invoke-virtual {v2, v3, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v2, p0, Lcom/waiqin365/lightapp/sales/b/a/e;->d:Ljava/util/HashMap;

    const-string/jumbo v3, "data.visit_implement_id"

    move-object/from16 v0, p2

    iget-object v4, v0, Lcom/waiqin365/lightapp/sales/c/a;->b:Ljava/lang/String;

    invoke-virtual {v2, v3, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v2, p0, Lcom/waiqin365/lightapp/sales/b/a/e;->d:Ljava/util/HashMap;

    const-string/jumbo v3, "data.location_c"

    move-object/from16 v0, p2

    iget-object v4, v0, Lcom/waiqin365/lightapp/sales/c/a;->k:Ljava/lang/String;

    invoke-virtual {v2, v3, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v2, p0, Lcom/waiqin365/lightapp/sales/b/a/e;->d:Ljava/util/HashMap;

    const-string/jumbo v3, "data.location_a"

    move-object/from16 v0, p2

    iget-object v4, v0, Lcom/waiqin365/lightapp/sales/c/a;->l:Ljava/lang/String;

    invoke-virtual {v2, v3, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v2, p0, Lcom/waiqin365/lightapp/sales/b/a/e;->d:Ljava/util/HashMap;

    const-string/jumbo v3, "data.location_type"

    move-object/from16 v0, p3

    invoke-virtual {v2, v3, v0}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v2, p0, Lcom/waiqin365/lightapp/sales/b/a/e;->d:Ljava/util/HashMap;

    const-string/jumbo v3, "data.pictures"

    move-object/from16 v0, p2

    iget-object v4, v0, Lcom/waiqin365/lightapp/sales/c/a;->m:Ljava/lang/String;

    invoke-virtual {v2, v3, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v2, p0, Lcom/waiqin365/lightapp/sales/b/a/e;->d:Ljava/util/HashMap;

    const-string/jumbo v3, "data.remark"

    move-object/from16 v0, p2

    iget-object v4, v0, Lcom/waiqin365/lightapp/sales/c/a;->s:Ljava/lang/String;

    invoke-virtual {v2, v3, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v2, p0, Lcom/waiqin365/lightapp/sales/b/a/e;->d:Ljava/util/HashMap;

    const-string/jumbo v3, "data.submit_date"

    move-object/from16 v0, p2

    iget-object v4, v0, Lcom/waiqin365/lightapp/sales/c/a;->t:Ljava/lang/String;

    invoke-virtual {v2, v3, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v2, p0, Lcom/waiqin365/lightapp/sales/b/a/e;->d:Ljava/util/HashMap;

    const-string/jumbo v3, "data.amount"

    move-object/from16 v0, p2

    iget-object v4, v0, Lcom/waiqin365/lightapp/sales/c/a;->j:Ljava/lang/Double;

    invoke-virtual {v4}, Ljava/lang/Double;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    new-instance v6, Lorg/json/JSONArray;

    invoke-direct {v6}, Lorg/json/JSONArray;-><init>()V

    const/4 v2, 0x0

    move v3, v2

    :goto_1
    move-object/from16 v0, p2

    iget-object v2, v0, Lcom/waiqin365/lightapp/sales/c/a;->u:Ljava/util/List;

    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v2

    if-ge v3, v2, :cond_3

    new-instance v7, Lorg/json/JSONObject;

    invoke-direct {v7}, Lorg/json/JSONObject;-><init>()V

    move-object/from16 v0, p2

    iget-object v2, v0, Lcom/waiqin365/lightapp/sales/c/a;->u:Ljava/util/List;

    invoke-interface {v2, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/waiqin365/base/db/jxccache/g;

    invoke-static {}, Lcom/fiberhome/gaea/client/base/ExmobiApp;->b()Lcom/fiberhome/gaea/client/base/ExmobiApp;

    move-result-object v4

    invoke-static {v4}, Lcom/waiqin365/base/db/offlinedata/w;->a(Landroid/content/Context;)Lcom/waiqin365/base/db/offlinedata/w;

    move-result-object v4

    invoke-virtual {v2}, Lcom/waiqin365/base/db/jxccache/g;->b()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Lcom/waiqin365/base/db/offlinedata/w;->f(Ljava/lang/String;)Lcom/waiqin365/base/db/offlinedata/s;

    move-result-object v5

    invoke-static {}, Lcom/fiberhome/gaea/client/base/ExmobiApp;->b()Lcom/fiberhome/gaea/client/base/ExmobiApp;

    move-result-object v4

    invoke-static {v4}, Lcom/waiqin365/base/db/offlinedata/w;->a(Landroid/content/Context;)Lcom/waiqin365/base/db/offlinedata/w;

    move-result-object v4

    invoke-virtual {v2}, Lcom/waiqin365/base/db/jxccache/g;->h()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v4, v8}, Lcom/waiqin365/base/db/offlinedata/w;->e(Ljava/lang/String;)Lcom/waiqin365/base/db/offlinedata/s;

    move-result-object v8

    :try_start_1
    const-string/jumbo v4, "id"

    invoke-virtual {v2}, Lcom/waiqin365/base/db/jxccache/g;->b()Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v7, v4, v9}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v4, "price"

    invoke-virtual {v2}, Lcom/waiqin365/base/db/jxccache/g;->f()Ljava/lang/Double;

    move-result-object v9

    const-wide/16 v10, 0x0

    invoke-static {v9, v10, v11}, Lcom/fiberhome/gaea/client/d/k;->a(Ljava/lang/Double;D)D

    move-result-wide v10

    invoke-virtual {v7, v4, v10, v11}, Lorg/json/JSONObject;->put(Ljava/lang/String;D)Lorg/json/JSONObject;

    const-string/jumbo v4, "qty"

    invoke-virtual {v2}, Lcom/waiqin365/base/db/jxccache/g;->g()Ljava/lang/Double;

    move-result-object v9

    const-wide/16 v10, 0x0

    invoke-static {v9, v10, v11}, Lcom/fiberhome/gaea/client/d/k;->a(Ljava/lang/Double;D)D

    move-result-wide v10

    invoke-virtual {v7, v4, v10, v11}, Lorg/json/JSONObject;->put(Ljava/lang/String;D)Lorg/json/JSONObject;

    const-string/jumbo v4, "amount"

    invoke-virtual {v2}, Lcom/waiqin365/base/db/jxccache/g;->f()Ljava/lang/Double;

    move-result-object v9

    const-wide/16 v10, 0x0

    invoke-static {v9, v10, v11}, Lcom/fiberhome/gaea/client/d/k;->a(Ljava/lang/Double;D)D

    move-result-wide v10

    invoke-virtual {v2}, Lcom/waiqin365/base/db/jxccache/g;->g()Ljava/lang/Double;

    move-result-object v9

    const-wide/16 v12, 0x0

    invoke-static {v9, v12, v13}, Lcom/fiberhome/gaea/client/d/k;->a(Ljava/lang/Double;D)D

    move-result-wide v12

    mul-double/2addr v10, v12

    invoke-virtual {v7, v4, v10, v11}, Lorg/json/JSONObject;->put(Ljava/lang/String;D)Lorg/json/JSONObject;

    const-string/jumbo v9, "remarks"

    invoke-virtual {v2}, Lcom/waiqin365/base/db/jxccache/g;->e()Ljava/lang/String;

    move-result-object v4

    if-nez v4, :cond_0

    const-string/jumbo v4, ""

    :goto_2
    invoke-virtual {v7, v9, v4}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v4, "input_unit"

    invoke-virtual {v2}, Lcom/waiqin365/base/db/jxccache/g;->h()Ljava/lang/String;

    move-result-object v9

    const-string/jumbo v10, "default"

    const-string/jumbo v11, ""

    invoke-virtual {v9, v10, v11}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v7, v4, v9}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v9, "base_unit"

    if-nez v5, :cond_1

    const-string/jumbo v4, ""

    :goto_3
    invoke-virtual {v7, v9, v4}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v9, "base_unit_qty"

    if-nez v8, :cond_2

    invoke-virtual {v2}, Lcom/waiqin365/base/db/jxccache/g;->g()Ljava/lang/Double;

    move-result-object v2

    const-wide/16 v4, 0x0

    invoke-static {v2, v4, v5}, Lcom/fiberhome/gaea/client/d/k;->a(Ljava/lang/Double;D)D

    move-result-wide v4

    :goto_4
    invoke-virtual {v7, v9, v4, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;D)Lorg/json/JSONObject;
    :try_end_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_0

    :goto_5
    invoke-virtual {v6, v7}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;

    add-int/lit8 v2, v3, 0x1

    move v3, v2

    goto/16 :goto_1

    :cond_0
    :try_start_2
    invoke-virtual {v2}, Lcom/waiqin365/base/db/jxccache/g;->e()Ljava/lang/String;

    move-result-object v4

    goto :goto_2

    :cond_1
    invoke-virtual {v5}, Lcom/waiqin365/base/db/offlinedata/s;->a()Ljava/lang/String;

    move-result-object v4

    const-string/jumbo v5, "default"

    const-string/jumbo v10, ""

    invoke-virtual {v4, v5, v10}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v4

    goto :goto_3

    :cond_2
    invoke-virtual {v2}, Lcom/waiqin365/base/db/jxccache/g;->g()Ljava/lang/Double;

    move-result-object v2

    const-wide/16 v4, 0x0

    invoke-static {v2, v4, v5}, Lcom/fiberhome/gaea/client/d/k;->a(Ljava/lang/Double;D)D

    move-result-wide v4

    invoke-virtual {v8}, Lcom/waiqin365/base/db/offlinedata/s;->e()Ljava/lang/Double;

    move-result-object v2

    const-wide/16 v10, 0x0

    invoke-static {v2, v10, v11}, Lcom/fiberhome/gaea/client/d/k;->a(Ljava/lang/Double;D)D
    :try_end_2
    .catch Lorg/json/JSONException; {:try_start_2 .. :try_end_2} :catch_0

    move-result-wide v10

    mul-double/2addr v4, v10

    goto :goto_4

    :catch_0
    move-exception v2

    invoke-virtual {v2}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_5

    :cond_3
    iget-object v2, p0, Lcom/waiqin365/lightapp/sales/b/a/e;->d:Ljava/util/HashMap;

    const-string/jumbo v3, "data.products"

    invoke-virtual {v6}, Lorg/json/JSONArray;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v2, p0, Lcom/waiqin365/lightapp/sales/b/a/e;->d:Ljava/util/HashMap;

    const-string/jumbo v3, "data.token"

    move-object/from16 v0, p4

    invoke-virtual {v2, v3, v0}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void

    :catch_1
    move-exception v2

    goto/16 :goto_0
.end method
